import java.util.Stack;
//链栈
public class MyLinkedStack {

    static class Node{
        public Node next;
        public int val;

        public Node(int val) {
            this.val = val;
        }
    }
    public Node head;
    public int pop() {
        if(empty()) {
            return -1;
        }
        int n=head.val;
        head=head.next;
        return n;

    }
    public int peek() {
        if(empty()) {
            return -1;
        }
        return head.val;
    }
    public void push(int x) {
        Node node=new Node(x);
            node.next = head;
            head=node;
    }
    public boolean empty() {
        return head==null;
    }
    public static int func(int n) {
        //递归打印n的阶层
        if(n==1) {
            return 1;
        }
        return n*func(n-1);
    }
    public static void main(String[] args) {
        System.out.println(func(5));
    }
}
class LinkQueue {

    static class Node{
        Node next;
        int val;
        public Node(int val) {
            this.val = val;
        }
    }
    public Node front;//头指针
    public Node rear;//尾指针

    public void offer(int x) {
        Node node=new Node(x);
        if(front==null) {
            front=node;
        } else {
            rear.next=node;
        }
        rear=node;
    }
    public int poll() {
        if(front==null) {
            //如果头节点为空就说明没有结点
            return -1;
        }
        int n=front.val;
        front=front.next;
        if(front==null) {
            rear=null;
        }
        return n;
    }

}
interface D{
    public int fuc();
}
class A implements D{


    @Override
    public int fuc() {
        return 0;
    }
}
class C extends A{

}